<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions">

    <body>
        <ui:composition template="/WEB-INF/templates/newMainCandidateTemplate.xhtml">
            <ui:define name="content">
                <h:outputStylesheet library="css" name="candidate/candidate.css"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="candidate/candidate_desktop.css" media="screen and (min-width:1025px) and (max-width:1600px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="candidate/candidate_desktop_wide.css" media="screen and (min-width : 1601px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="candidate/candidate_tablet.css" media="screen and (min-device-width : 768px) and (max-device-width : 1024px), screen and (max-width:1024px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="candidate/candidate_smartphone.css" media="screen and (min-device-width : 320px) and (max-device-width : 767px), screen and (max-width:767px)"></h:outputStylesheet>
                
                
                <h:form id="interestForm">
                    <p:panel id="editInterestPanel" styleClass="noPaddingTopTitle noMargin  noBorder marginTopBar" header="#{messages.Interest}">
                        <p:selectOneMenu filter="true" filterMatchMode="contains" converter="#{sectorConverter}"  value="#{newEditCandidateBean.collectorInterestArea.sector}" effect="fade" label="#{messages.Sector}">  
                            <f:selectItem itemLabel="#{messages.Sector}" itemValue="" />  
                            <f:selectItems value="#{userResourcesBean.sectors}" var="sector" itemLabel="#{sectorBundle[sector.idSector.toString()]}" itemValue="#{sector}"/>
                            <p:ajax update="editInterestPanel"/>
                        </p:selectOneMenu>
                        <p:selectOneMenu filter="true" filterMatchMode="contains" converter="#{jobPositionConverter}"   value="#{newEditCandidateBean.collectorInterestArea.jobPosition}" effect="fade" label="#{messages.JobPosition}">  
                            <f:selectItem itemLabel="#{messages.JobPosition}" itemValue="" />  
                            <f:selectItems value="#{userResourcesBean.jobPositions}" var="jobPosition" itemLabel="#{jobPositionBundle[jobPosition.idJobPosition.toString()]}" itemValue="#{jobPosition}"/>
                            <p:ajax update="editInterestPanel"/>
                        </p:selectOneMenu>
                        <p:selectOneMenu converter="#{desiredSalaryConverter}" value="#{newEditCandidateBean.collectorInterestArea.desiredSalary}" effect="fade" label="#{messages.DesiredSalary}">  
                            <f:selectItem itemLabel="#{messages.DesiredSalary}" itemValue="" />  
                            <f:selectItems value="#{resourcesBean.desiredSalaries}" var="desiredSalary" itemLabel="#{desiredSalary.description}" itemValue="#{desiredSalary}"/>  
                            <p:ajax update="editInterestPanel"/>
                        </p:selectOneMenu>
                        <p:commandButton rendered="#{newEditCandidateBean.collectorInterestArea.idCandidateInterestArea==null}" actionListener="#{newEditCandidateBean.saveInterest()}" process="@parent" styleClass=" grayBackgroundStrong" disabled="#{newEditCandidateBean.collectorInterestArea.sector==null and newEditCandidateBean.collectorInterestArea.jobPosition==null and newEditCandidateBean.collectorInterestArea.desiredSalary==null}"  id="butonAddInterestAreaDialog" value="#{messages.Add}" action="#{newEditCandidateBean.reditectToInterestPanel()}"  ></p:commandButton>  
                        <p:commandButton rendered="#{newEditCandidateBean.collectorInterestArea.idCandidateInterestArea!=null}" actionListener="#{newEditCandidateBean.editInterest()}" process="@parent" styleClass=" grayBackgroundStrong" disabled="#{newEditCandidateBean.collectorInterestArea.sector==null and newEditCandidateBean.collectorInterestArea.jobPosition==null and newEditCandidateBean.collectorInterestArea.desiredSalary==null}"  id="butonEditInterestAreaDialog" value="#{messages.Edit}" action="#{newEditCandidateBean.reditectToInterestPanel()}"   ></p:commandButton>  
                        <p:commandButton process="@this" styleClass="marginBottom05em marginTop05em grayBackgroundStrong block" id="back_button" value="#{messages.Cancel}" action="#{newEditCandidateBean.cancelReditectInterestPanel()}"></p:commandButton>
                    </p:panel>
                </h:form>
            </ui:define>
        </ui:composition>
         
    </body>
</html>
